/*
 * Copyright (C) 2004, Velocityme Partnership
 * TaskValueActionForm.java
 *
 * Created on 12 September 2004, 10:14
 */

package com.velocityme.www.actionforms.nodeactionforms;

import java.util.ArrayList;
import java.util.Collection;
import org.apache.struts.action.ActionMapping;

/**
 *
 * @author  Robert
 */
public class TaskValueActionForm extends NodeValueActionForm {
    
    private Integer m_ownerId;
    private Integer m_taskTypeId;
    private Integer m_priority;
    private Byte m_percentageComplete;
    private Integer m_durationDays;
    private Integer m_durationHours;
    private Integer m_durationMins;
    private Boolean m_isInterested;
    private Collection<Long> m_allInterestedContactableIds;
    private Collection<Long> m_interestedContactableIds;
    private Collection<Long> m_allResponsibleContactableIds;
    private Collection<Long> m_responsibleContactableIds;

    /** Creates a new instance of TaskValueActionForm */
    public TaskValueActionForm() {
    }

    @Override
    public void reset(ActionMapping mapping, javax.servlet.http.HttpServletRequest request) {
        m_priority = new Integer(50);
        m_isInterested = new Boolean(false);
        m_interestedContactableIds = new ArrayList<Long>();
        m_responsibleContactableIds = new ArrayList<Long>();
    }
    
    public Integer getOwnerId() {
        return m_ownerId;
    }
    
    public void setOwnerId(Integer ownerId) {
        m_ownerId = ownerId;
    }
    
    public Integer getTaskTypeId() {
        return m_taskTypeId;
    }
    
    public void setTaskTypeId(Integer taskTypeId) {
        m_taskTypeId = taskTypeId;
    }
    
    public Integer getPriority() {
        return m_priority;
    }
    
    public void setPriority(Integer priority) {
        m_priority = priority;
    }
    
    public Byte getPercentageComplete() {
        return m_percentageComplete;
    }
    
    public void setPercentageComplete(Byte percentageComplete) {
        m_percentageComplete = percentageComplete;
    }
    
    public Integer getDurationDays() {
        return m_durationDays;
    }
    
    public void setDurationDays(Integer durationDays) {
        m_durationDays = durationDays;
    }
    
    public Integer getDurationHours() {
        return m_durationHours;
    }
    
    public void setDurationHours(Integer durationHours) {
        m_durationHours = durationHours;
    }
    
    public Integer getDurationMins() {
        return m_durationMins;
    }
    
    public void setDurationMins(Integer durationMins) {
        m_durationMins = durationMins;
    }
    
    public Boolean getIsInterested() {
        return m_isInterested;
    }
    
    public void setIsInterested(Boolean isInterested) {
        m_isInterested = isInterested;
    }
    
    public Collection<Long> getAllInterestedContactableIds() {
        return m_allInterestedContactableIds;
    }
    
    public void setAllInterestedContactableIds(Collection<Long> allInterestedContactableIds) {
        m_allInterestedContactableIds = allInterestedContactableIds;
    }
    
    public Collection<Long> getInterestedContactableIds() {
        return m_interestedContactableIds;
    }
    
    public void setInterestedContactableIds(Collection<Long> interestedContactableIds) {
        m_interestedContactableIds = interestedContactableIds;
    }
    
    public Collection<Long> getAllResponsibleContactableIds() {
        return m_allResponsibleContactableIds;
    }
    
    public void setAllResponsibleContactableIds(Collection<Long> allResponsibleContactableIds) {
        m_allResponsibleContactableIds = allResponsibleContactableIds;
    }
    
    public Collection<Long> getResponsibleContactableIds() {
        return m_responsibleContactableIds;
    }
    
    public void setResponsibleContactableIds(Collection<Long> responsibleContactableIds) {
        m_responsibleContactableIds = responsibleContactableIds;
    }
    
    public Integer getDurationTotalMins() {
        return new Integer(m_durationDays.intValue() * 8 * 60 + m_durationHours.intValue() * 60 + m_durationMins.intValue());
    }
    
    public void setDurationTotalMins(Integer totalMins) {
        m_durationDays = new Integer(totalMins.intValue() / (8 * 60));
        m_durationHours = new Integer((totalMins.intValue() / 60) % 8);
        m_durationMins = new Integer(totalMins.intValue() % 60);
    }
    
}
